# cmus-rg (cmus-remote graphical)

A simple graphical cmus status display in C using SDL2. Some elements can be clicked to control cmus remotely. Developed for educational purposes.

### screenshots

<p align="center">
  <img width="160" height="160" src="./res/demo1.png">
  <img width="160" height="160" src="./res/demo4.png">
  <img width="160" height="160" src="./res/demo5.png">
  <img width="160" height="160" src="./res/demo2.png">
  <img width="160" height="160" src="./res/demo3.png">
  <img width="160" height="160" src="./res/demo6.png">
</p>
<p align="center">
  <img src="./res/demo_full.png" mouseover="lmao">
</p>

### install (unix)

1. install libavformat ([ffmpeg.org](https://ffmpeg.org/libavformat.html)) as well as SDL2 ([www.libsdl.org](http://www.libsdl.org/)) *with* development headers and dependencies

- SDL2
- SDL2-devel
- SDL2_image
- SDL2_image-devel
- SDL2_ttf
- SDL2_ttf-devel
- libavformat
- ffmpeg-devel

2. use `make` to compile `cmus-rg`, or `make install` to compile and install to `/bin` (requires elevated permissions)

3. run with `./cmus-rg`, or `cmus-rg` if cmus-rg has been installed to `/bin`

### features in need of implementation

one day for sure

- [x] include fonts
- [x] UTF8 support
- [x] album art support
  - requires `id3-extract-cover`
  - supports all image formats supported by SDL2
  - supports only images encoded in id3v2 within mp3 files
- [ ] dynamic font loading
  - half heartedly implemented, just add font in `graphics.c`
- [x] better metadata presentation
- [ ] actual cmus-remote functionality (pausing cmus, et cetera)
  - [x] pause
  - [ ] seek
  - [x] next/prev
  - [x] toggle aaa_mode
- [x] scripting capabilities by adding flags
  - [x] dimension parameters
  - [x] font parameter
    - supports only full paths to TTF files for now
  - [x] font size
    - supports only TTF fonts
- [x] recognition of streams instead of just local files
- [x] support for resizing

### credits

Redistributes M+ FONTS (https://mplus-fonts.osdn.jp/), an awesome and freely redistributable font that supports UTF8.

Initially inspired by [https://github.com/dashed/tetris-sdl-c], who provides an easy way to get into SDL2 for C.

### license

MIT
